package o;

import android.content.Context;
import com.huawei.appgallery.forum.base.card.bean.Section;
import com.huawei.appgallery.forum.base.card.bean.User;
import com.huawei.appgallery.forum.cards.bean.ForumFeedRecommendCardBean;
import com.huawei.appgallery.forum.cards.bean.ForumFollowCardBean;
import com.huawei.appgallery.forum.cards.node.ForumFeedPostNode;
import com.huawei.appgallery.forum.cards.node.ForumFeedRecommendNode;
import com.huawei.appgallery.forum.cards.node.ForumFollowNode;
import com.huawei.appgallery.forum.cards.node.ForumRecommendSectionNode;
import com.huawei.appgallery.forum.user.usercenter.bean.ForumFollowUserCardBean;
import com.huawei.appgallery.forum.user.usercenter.node.ForumFollowUserNode;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import java.util.List;

public class bve extends chl {
    public bve(Context context) {
        super(context);
    }

    public boolean ˊ(Section section) {
        if (section == null || this.ॱॱ == null || this.ॱॱ.size() == 0) {
            return false;
        }
        boolean z = false;
        for (chz o_chz : this.ॱॱ) {
            boolean ˊ = ˊ(o_chz, section);
            boolean ˋ = ˋ(o_chz, section);
            if (ˊ || ˋ) {
                ˋ = true;
            } else {
                ˋ = z;
            }
            z = ˋ;
        }
        return z;
    }

    private boolean ˊ(chz o_chz, Section section) {
        if (!(o_chz.ˋ instanceof ForumFeedRecommendNode)) {
            return false;
        }
        List<CardBean> ˏ = o_chz.ˏ();
        if (ˏ == null || ˏ.size() == 0) {
            return false;
        }
        boolean z = false;
        for (CardBean cardBean : ˏ) {
            boolean ˏ2;
            if (cardBean instanceof ForumFeedRecommendCardBean) {
                ˏ2 = ((ForumFeedRecommendCardBean) cardBean).ˏ(section);
            } else {
                ˏ2 = z;
            }
            z = ˏ2;
        }
        return z;
    }

    private boolean ˋ(chz o_chz, Section section) {
        if (!(o_chz.ˋ instanceof ForumRecommendSectionNode) && !(o_chz.ˋ instanceof ForumFollowNode)) {
            return false;
        }
        List<CardBean> ˏ = o_chz.ˏ();
        if (ˏ == null || ˏ.size() == 0) {
            return false;
        }
        boolean z = false;
        for (CardBean cardBean : ˏ) {
            boolean z2;
            if (cardBean instanceof ForumFollowCardBean) {
                Section ˊ = ((ForumFollowCardBean) cardBean).ˊ();
                if (ˊ != null && ˊ.ˊ() == section.ˊ()) {
                    ˊ.ˏ(section.ᐝ());
                    z2 = true;
                    z = z2;
                }
            }
            z2 = z;
            z = z2;
        }
        return z;
    }

    public boolean ˊ() {
        if (this.ʽ) {
            return false;
        }
        if (this.ॱॱ != null && this.ॱॱ.size() > 0) {
            for (chz o_chz : this.ॱॱ) {
                if ((o_chz.ˋ instanceof ForumFeedPostNode) && o_chz.ˎ != null && o_chz.ˎ.size() > 0) {
                    return true;
                }
            }
        }
        return false;
    }

    public boolean ˎ(String str, int i) {
        if (this.ॱॱ == null || this.ॱॱ.size() == 0 || cgy.ॱ(str)) {
            return false;
        }
        boolean z = false;
        for (chz o_chz : this.ॱॱ) {
            boolean ˎ = ˎ(o_chz, str, i);
            boolean ˏ = ˏ(o_chz, str, i);
            if (ˎ || ˏ) {
                ˏ = true;
            } else {
                ˏ = z;
            }
            z = ˏ;
        }
        return z;
    }

    private boolean ˎ(chz o_chz, String str, int i) {
        if (!(o_chz.ˋ instanceof ForumFeedRecommendNode)) {
            return false;
        }
        List<CardBean> ˏ = o_chz.ˏ();
        if (ˏ == null || ˏ.size() == 0) {
            return false;
        }
        boolean z = false;
        for (CardBean cardBean : ˏ) {
            boolean ˎ;
            if (cardBean instanceof ForumFeedRecommendCardBean) {
                ˎ = ((ForumFeedRecommendCardBean) cardBean).ˎ(str, i);
            } else {
                ˎ = z;
            }
            z = ˎ;
        }
        return z;
    }

    private boolean ˏ(chz o_chz, String str, int i) {
        if (!(o_chz.ˋ instanceof ForumFollowUserNode)) {
            return false;
        }
        List<CardBean> ˏ = o_chz.ˏ();
        if (ˏ == null || ˏ.size() == 0) {
            return false;
        }
        boolean z = false;
        for (CardBean cardBean : ˏ) {
            boolean z2;
            if (cardBean instanceof ForumFollowUserCardBean) {
                User ˊ = ((ForumFollowUserCardBean) cardBean).ˊ();
                if (!(ˊ == null || ˊ.ॱˋ() == null || !ˊ.ॱˋ().equals(str) || ˊ.ʻॱ() == i)) {
                    int ˊॱ = ˊ.ˊॱ();
                    if (i == 1 || i == 2) {
                        ˊ.ᐝ(ˊॱ + 1);
                    } else {
                        ˊ.ᐝ(ˊॱ == 0 ? 0 : ˊॱ - 1);
                    }
                    ˊ.ˎ(i);
                    z2 = true;
                    z = z2;
                }
            }
            z2 = z;
            z = z2;
        }
        return z;
    }
}
